﻿using System;
using System.Collections.Generic;
using System.Linq;
using Autodesk.Revit.DB;

namespace YArchitech.Plumbing
{
	public class HYEquipmentCommon
	{
		public ICollection<ElementId> GetAllFamilyInstance(Autodesk.Revit.DB.Document doc, BuiltInCategory builtInCategory)
		{
			FilteredElementCollector filteredElementCollector = new FilteredElementCollector(doc);
			new ElementOwnerViewFilter(doc.ActiveView.Id);
			return filteredElementCollector.OfCategory(builtInCategory).OfClass(typeof(FamilyInstance)).ToElementIds();
		}

		public ICollection<Element> GetAllTag(Autodesk.Revit.DB.Document doc, BuiltInCategory builtInCategory)
		{
			FilteredElementCollector filteredElementCollector = new FilteredElementCollector(doc);
			ElementOwnerViewFilter elementOwnerViewFilter = new ElementOwnerViewFilter(doc.ActiveView.Id);
			return filteredElementCollector.WherePasses(elementOwnerViewFilter).OfCategory(builtInCategory).OfClass(typeof(IndependentTag)).ToList<Element>();
		}
	}
}
